<template>
    <div>
        <div id="paymentContainer"></div>
    </div>
</template>

<script>
import { doPay } from '@/api/vip';



export default {
    created(){
        console.log(1111);
        
    },
    mounted() {
        const num = this.$route.params.num
        const duration=this.$route.params.duration
        
        
        doPay({ "num": num ,
            "duration":duration
        }).then(res => {

            const paymentHtml = res; // 后端返回的 HTML 字符串

            // 将 HTML 插入容器
            const container = document.getElementById('paymentContainer');
            container.innerHTML = paymentHtml;
            // 手动触发表单提交
            const form = container.querySelector('form');
            if (form) {
                form.submit(); // 提交表单，跳转到支付页面
            }

        })
    }

}
</script>

<style></style>